home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Toolbox / ictbSample / ictbSample.r < prev    next >
Encoding:
Text File  |  1996-08-15  |  4.5 KB  |  157 lines  |  [TEXT/CWIE]

  1. /*
  2.     ictbSample.r
  3.     
  4.     Use of ictb snippet
  5.     Albert Hui -- MacDTS
  6.     
  7.     This snippet shows the an example of ictb resource this is discussed in 
  8.     Inside Macintosh:Macintosh Toolbox Essentials, page 6-158 t0 6-164.
  9.     It is based on the Dialog Manager Q&A technote and modified from ictb sample
  10.     from Ramon Silva.  You can find the technote
  11.     in the latest developer CD:
  12.     
  13.         Dev.CD Jun 96 RL
  14.           Technical Documentation
  15.             Macintosh Technical Notes
  16.               Archive
  17.                 Toolbox
  18.                   tb_525.html.
  19.              
  20.     There is no Rez template for it, and no ResEdit template or editor.  This sample
  21.     ictbSample.r shows how you can do one by hand.
  22.  
  23.     The best solution is to get Resorcerer which provides an excellent ictb editor. 
  24.     With Resorcerer, it is really simple to use ictb in your dialog boxes.
  25.     
  26.     This sample is built with CW 9. 
  27. */
  28.  
  29. #include "Types.r"
  30.  
  31.  
  32.  
  33. /* dlog stuff */
  34. resource 'DLOG' (128) {
  35.     {80, 74, 290, 464},
  36.     dBoxProc,
  37.     visible,
  38.     goAway,
  39.     0x0,
  40.     128,
  41.     ""
  42. };
  43.  
  44. resource 'DITL' (128) {
  45.     {    /* array DITLarray: 8 elements */
  46.         /* [1] */
  47.         {185, 305, 205, 363},
  48.         Button {
  49.             enabled,
  50.             "Done"
  51.         },
  52.         /* [2] */
  53.         {46, 290, 64, 369},
  54.         CheckBox {
  55.             enabled,
  56.             "Memory"
  57.         },
  58.         /* [3] */
  59.         {97, 290, 115, 369},
  60.         CheckBox {
  61.             enabled,
  62.             "Memory"
  63.         },
  64.         /* [4] */
  65.         {148, 290, 166, 369},
  66.         CheckBox {
  67.             enabled,
  68.             "Memory"
  69.         },
  70.         /* [5] */
  71.         {41, 12, 70, 275},
  72.         EditText {
  73.             enabled,
  74.             ""
  75.         },
  76.         /* [6] */
  77.         {92, 12, 121, 275},
  78.         EditText {
  79.             enabled,
  80.             ""
  81.         },
  82.         /* [7] */
  83.         {143, 12, 172, 275},
  84.         EditText {
  85.             enabled,
  86.             ""
  87.         },
  88.         /* [8] */
  89.         {5, 6, 21, 269},
  90.         StaticText {
  91.             disabled,
  92.             "Type into them to see whats up"
  93.         }
  94.     }
  95. };
  96.  
  97. resource 'dctb' (128) {
  98.     {    /* array ColorSpec: 5 elements */
  99.         /* [1] */
  100.         wContentColor, 65535, 65535, 52428,
  101.         /* [2] */
  102.         wFrameColor, 0, 0, 0,
  103.         /* [3] */
  104.         wTextColor, 0, 0, 0,
  105.         /* [4] */
  106.         wHiliteColor, 0, 0, 0,
  107.         /* [5] */
  108.         wTitleBarColor, 65535, 65535, 65535
  109.     }
  110. };
  111.  
  112. data 'ictb' (128) {
  113.     $"0020 0020"           /*$00 the button */
  114.     $"0000 0000"           /*$04 Check box 1 */
  115.     $"0000 0000"           /*$08 Check box 2  */
  116.     $"0000 0000"           /*$0C Check box 3  */
  117.     $"0000 0000"           /*$10 Edit Text 1  */
  118.     $"000D 0040"           /*$14 Edit Text 2 just change the family, */
  119.                            /*                   size, and text color */
  120.     $"8005 0054"           /*$18 Edit Text 3 change family and size, */
  121.                            /*                        using font name */
  122.     $"8005 0068"           /*$1C Stat Text 1 */
  123. /* Start of the ictb items here */
  124.     /* Color table for the done button */
  125.     $"0000 0000"           /*$20 ccSeed */
  126.     $"0000 0002"           /* Reserved / size of color table */
  127.     $"0000 0000 0000 FFFF" /* cFrameColor, 65535,65535,52428 */
  128.     $"0001 FFFF FFFF CCCC" /* cBodyColor, 0, 0, 0 */
  129.     $"0002 0000 0000 FFFF" /* cTextColor, 0, 0, 65535 */
  130.     /* Edit Text item 5 text/color info... */
  131.     $"0001"                /*$40 diFont application font */
  132.     $"0000"                /*$42 diStyle plain */
  133.     $"000A"                /*$44 diSize whatever... */
  134.     $"FFFF 8000 0000"      /*$46 forecolor */
  135.     $"FFFF FFFF CCCC"      /*$4C backColor */
  136.     $"0000"                /*$52 diMode */
  137.       /* Edit Text item 6 text/color info... */
  138.     $"008C"                /*$54 diFont application font */
  139.     $"0000"                /*$56 diStyle outline  */
  140.     $"000C"                /*$58 diSize whatever... */
  141.     $"0000 0000 0000"      /*$5A forecolor */
  142.     $"FFFF FFFF CCCC"      /*$60 backColor */
  143.     $"0000"                /*$66 diMode */
  144.     /* Edit static text item 8 /color info... */
  145.     $"007C"                /*$68 diFont application font */
  146.     $"0000"                /*$6A diStyle plain */
  147.     $"000C"                /*$6C diSize whatever... */
  148.     $"0000 0000 0000"      /*$6E forecolor */
  149.     $"FFFF FFFF CCCC"      /*$74 backColor */
  150.     $"0000"                /*$7A diMode */
  151. /* Start of the font name table here */
  152.     $"0743 6F75 7269 6572" /*$7C font name Courier */
  153.     $"0647 656E 6576 6100" /*$84 font name Geneva */
  154.     $"0850 616C 6174 696E" /*$8C font name Palatino */
  155.     $"6F00" 
  156. };
  157.